<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<script>
    var a = 10;
    var b = 20;
    console.log(a,typeof a,b,typeof b);
    var c="wdwdw";
    var d='wdqdq';
    console.log(c,typeof c,d,typeof d);//单双引号都是字符串类型
    var e = true;
    var f = false;
    console.log(e,typeof e,f,typeof f);
    var g;//声明但未定义的变量，默认为undefined
    console.log(g,typeof g);
    let obj={};
    console.log(obj,typeof obj);
    obj.name="zs";
    obj.age=18;
    console.log(obj,typeof obj);
    console.log(obj.name,obj.age);

     let obj2={name:"lisi",age:19};
    console.log(obj2,typeof obj2);
    console.log(obj2.name,obj2.age);

    let arr=[1,2.4,true,'3'];
    console.log(arr,typeof arr);
    console.log(arr[0],arr[1],arr[2],arr[3]);
 //Number() 将参数转为数字类型 得不到结果会得到NaN(Not a Number)
    console.log(Number(true),typeof Number(true));
    console.log(Number(false),typeof Number(false));
    console.log(Number('123'));
    console.log(Number("123.4"));
    console.log(Number("哈哈哈"));
    //Boolean() 将参数转为布尔类型
    console.log(Boolean(1));
    //0,NaN,undefined,false,空字符串 结果全为false
    console.log(Boolean(0));
    console.log(Boolean(null));
    console.log(Boolean(NaN));
    console.log(Boolean(undefined));
    console.log(Boolean(''));
    console.log(Boolean(' '));//true

</script>
</body>
</html>